#ifndef GAMESTATE_H_
#define GAMESTATE_H_

// By: Jesse Guarascia de Urena
// Game state base class
// All in-game GameStates must inherit this class
// Internally deals with input and updating

#include <SDL.h>
#include "AssetManager.h"
#include "InputDevice.h"

class GameState : public AssetManager, public InputDevice
{
protected:
	// Running state of the Game State
	// 0 is fine, anything else quits
	int runState;

	// Engine specific settings
	int frameRate; // Frame rate used by the gameStates
	int dispWidth, dispHeight; // Display sizes for the game states
	bool fullScreen; // W-o-N the window is fullscreen

	bool running; // W-o-N the state is running

public:
	explicit GameState(void);
	virtual ~GameState(void);

	int Update(); // Update the module

	// Event functions
	virtual void OnUpdate() {}
	virtual void OnOpen() {} // Called when the engine executes the gameState
	virtual void OnRender() {}

	// Get the frame rate
	inline int FrameRate() { return frameRate; }

	// Get the dimensions for the display
	inline int DisplayWidth() { return dispWidth; }
	inline int DisplayHeight() { return dispHeight; }

	// Get the fullscreen flag
	inline bool isFullScreen() { return fullScreen; }
	inline bool isRunning() { return running; }
};

#endif // GAMESTATE_H_

